Assign ================= 将输入张量的值复制到输出张量中,实现张量赋值操作。 .. math:: dst_i = src_i 输入: - **src** - 输入数据地址。 - **length** - 数组长度(元素个数)。 - **core_mask(int, 可选)** - 核掩码(仅适用于共享存储版本)。 输出: - **dst** - 输出数据地址。 支持平台: ``FT78NE`` ``MT7004`` .. note:: - FT78NE 支持的数据类型:int8, int16, int32, fp32, fp64, cplx64, cplx128 - MT7004 支持的数据类型:fp16, fp32, int16, int32, cplx64 **共享存储版本:** .. c:function:: void i8_assign_s(int8_t* src, int8_t* dst, int length, int core_mask) .. c:function:: void i16_assign_s(int16_t* src, int16_t* dst, int length, int core_mask) .. c:function:: void i32_assign_s(int32_t* src, int32_t* dst, int length, int core_mask) .. c:function:: void fp_assign_s(float* src, float* dst, int length, int core_mask) .. c:function:: void dp_assign_s(double* src, double* dst, int length, int core_mask) .. c:function:: void c64_assign_s(float* src, float* dst, int length, int core_mask) .. c:function:: void c128_assign_s(double* src, double* dst, int length, int core_mask) .. c:function:: void hp_assign_s(half* src, half* dst, int length, int core_mask) **C调用示例:** .. code-block:: c :linenos: :emphasize-lines: 10 // FT78NE 多核示例 #include #include int main(int argc, char* argv[]) { float *src = (float *)0xA0000000; // src在DDR空间 float *dst = (float *)0xB0000000; int length = 1000; int core_mask = 0xff; fp_assign_s(src, dst, length, core_mask); return 0; } **私有存储版本:** .. c:function:: void i8_assign_p(int8_t* src, int8_t* dst, int length) .. c:function:: void i16_assign_p(int16_t* src, int16_t* dst, int length) .. c:function:: void i32_assign_p(int32_t* src, int32_t* dst, int length) .. c:function:: void fp_assign_p(float* src, float* dst, int length) .. c:function:: void dp_assign_p(double* src, double* dst, int length) .. c:function:: void c64_assign_p(float* src, float* dst, int length) .. c:function:: void c128_assign_p(double* src, double* dst, int length) .. c:function:: void hp_assign_p(half* src, half* dst, int length) **C调用示例:** .. code-block:: c :linenos: :emphasize-lines: 9 // MT7004 单核示例 #include #include int main(int argc, char* argv[]) { half *src = (half *)0x10000000; // src在L2空间 half *dst = (half *)0x10004000; int length = 1000; hp_assign_p(src, dst, length); return 0; }